<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends CI_Controller {

    function __construct(){
        parent::__construct();
        $this->load->model('product/product_model');
    }

    public function index(){
        $data['product_newest']    = $this->product_model->get_product(0, 0, 6, 0, 'create_date', 'DESC', ACTIVE_FLAG);
        $data['product_hot']       = $this->product_model->get_product_hot(0, 6, 0 );
        $data['product_promotion'] = $this->product_model->get_product_promotion(6);
        $data['product_category']  = $this->product_model->get_product_category(6);
        $data['tpl']               = 'home/index';
        $this->load->view('_layout/index', $data);
    }

    function err_404(){
        $data['tpl'] = 'home/err_404';
        $this->load->view('_layout/index', $data);
    }

    function contact(){
        $data['tpl'] = 'home/contact';
        $this->load->view('_layout/index', $data);
    }
}